home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 95 / pascal / fmtutils.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-01-15  |  2.7 KB  |  95 lines

  1. {$M+,E+}        { turn on modular compilation, external symbols }
  2.  
  3. program fmtutils;
  4.  
  5. CONST
  6.  
  7.    DriveA = 0;          { Drive A is 0... }
  8.    DriveB = 1;          { Drive B is 1... }
  9.  
  10.    SngSid40 = 0;        { Types of drive formats available... }
  11.    DblSid40 = 1;        { same as ProtoBoot function in XBIOS }
  12.    SngSid80 = 2;
  13.    DblSid80 = 3;
  14.  
  15.    RetStat = -1;        { for WrtVer below... }
  16.    Off = 0;
  17.    On = 1;
  18.  
  19. TYPE
  20.  
  21.    Flop_Typ  = DriveA..DriveB;          { drives A and B only, thanks... }
  22.    Fmt_Typ = SngSid40..DblSid80;        { type codes...                  }
  23.    VerTyp   = RetStat..On;              { for wrtver func..              }
  24.    Drv_Range = 0..15;                   { valid drive ranges...          }
  25.  
  26. FUNCTION  is_drive( dnum : INTEGER )     : BOOLEAN; C;
  27. FUNCTION  verify( f: INTEGER )           : BOOLEAN; C;
  28. FUNCTION  num_drive                      : INTEGER; C;
  29. FUNCTION  format( d, t : INTEGER )       : BOOLEAN; C;
  30.  
  31. {=========================================================================
  32.  
  33.         FmtDsk( Drive, Type )
  34.                 Format a disk in drive a or b of type Type (see above)
  35.                 Returns FALSE if not able to format disk, or
  36.                 TRUE if all is well.
  37.  
  38. ==========================================================================}
  39.  
  40. FUNCTION FmtDsk( Drive : Flop_Typ; Typ : Fmt_Typ ) : BOOLEAN;
  41.  
  42.    Begin
  43.       FmtDsk := format( Drive, Typ );
  44.    End;
  45.  
  46. {=========================================================================
  47.  
  48.         WrtVer( Func ) sets / inquires status of write verify flag on
  49.         floppy disk systems.
  50.         returns TRUE if write verify is on, else FALSE
  51.  
  52. ==========================================================================}
  53.  
  54.  
  55. FUNCTION WrtVer( Func : VerTyp ) : BOOLEAN;
  56.  
  57.    Begin
  58.       WrtVer := verify( Func ); { return verify status, and set if nessecary }
  59.    End;
  60.  
  61.  
  62. {=========================================================================
  63.  
  64.         IsDrive( dnum ) returns TRUE if drive DNUM is an installed drive.
  65.         this is NOT reliable in the case of installable devices such as
  66.         ramdisks or hard drives, since <resetting> the computer DOES NOT
  67.         tell the system to clear out this info.
  68.  
  69. ===========================================================================}
  70.  
  71. FUNCTION IsDrive( Dnum : Drv_Range ) : BOOLEAN;
  72.  
  73.    Begin
  74.       IsDrive := is_drive( Dnum );
  75.    End;
  76.  
  77.  
  78.  
  79. {=========================================================================
  80.  
  81.         NumDriv returns the number of floppy disk drives connected.
  82.  
  83. ==========================================================================}
  84.  
  85. FUNCTION NumDriv : Flop_Typ;
  86.  
  87.    Begin
  88.       NumDriv := num_drive;
  89.    End;
  90.  
  91.  
  92. Begin
  93. End.
  94.  
  95.